package org.mzy.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.mzy.basic.domain.BaseDomain;

import java.util.ArrayList;
import java.util.List;

/**
 * @Package: org.mzy.org.domain
 * @ClassName: Department
 * @Date:2022/9/28 11:02
 * @Description:
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    // 部门编号
    private String sn;
    // 部门名
    private String name;
    // 部门路径
    private String dirPath;
    // 部门状态
    private Integer state;
    // 部门经理id
    private Long managerId;
    // 上级部门id
    private Long parentId;
    // 部门经理
    private Employee manager;
    // 上级部门
    private Department parent;
    // 属性为空（""） 或者为 NULL 都不序列化
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();
    // 经理名字
    private String username;
}
